#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10 + 5;
int a[MAXN][MAXN];
int dp[MAXN][MAXN];
int paths[MAXN][MAXN];
int main()
{
#ifdef LOCAL
    freopen("ADV-293.in", "r", stdin);
#endif
    int n; cin >> n;
    for(int i = 1; i <= n; ++i)
        for(int j = 1; j <= n; ++j)
            cin >> a[i][j];
    dp[n][1] = a[n][1]; 
    for(int i = n - 1; i >= 1; --i) dp[i][1] = dp[i + 1][1] + a[i][1];
    for(int i = 2; i <= n; ++i) dp[n][i] = dp[n][i - 1] + a[n][i];
    for(int i = 1; i <=n; ++i) 
        paths[i][1] = paths[n][i] = 1;
    
    // 求出最长的值
    for(int i = n - 1; i >= 1; --i)
    {
        for(int j = 2; j <= n; ++j)
        {
            dp[i][j] = max(dp[i + 1][j], dp[i][j - 1]) + a[i][j];
        }
    }
    
    // 求出路径的数量
    for(int i = n - 1; i >= 1; --i)
    {
        for(int j = 2; j <= n; ++j)
        {
             
            if(dp[i + 1][j] > dp[i][j - 1]) paths[i][j] = paths[i + 1][j];
            else if(dp[i + 1][j] < dp[i][j - 1]) paths[i][j] = paths[i][j - 1];
            else paths[i][j] = paths[i + 1][j] + paths[i][j - 1];
        }
    }
    cout << paths[1][n] << " " << dp[1][n] << endl;
    return 0;
}